Title Banner

Previous Book Contents Book Index Next

Inside Macintosh: QuickDraw GX Graphics /
Chapter 2 - Geometric Shapes / Geometric Shapes Reference
Functions / Getting and Setting Shape Geometries


GXGetRectangle

You can use the GXGetRectangle function to determine the geometry of an existing rectangle shape.

gxRectangle *GXGetRectangle(gxShape source, gxRectangle *data);
source
A reference to the rectangle shape whose geometry you want to determine.
data
A pointer to a gxRectangle structure. The function copies the source shape's geometry into this structure.
function result
A pointer to a copy of the source shape's geometry.
DESCRIPTION
The GXGetRectangle function copies the geometry information from the source rectangle shape into the gxRectangle data structure pointed to by the data parameter. As a convenience, this function also returns a pointer to the rectangle geometry as the function result.

If the source shape is not a rectangle shape, this function posts the error code illegal_type_for_shape.

You must pass a pointer to a gxRectangle structure in the data parameter--if you pass nil for this parameter, the function posts the error code parameter_is_nil.

ERRORS, WARNINGS, AND NOTICES
Errors 
out_of_memory 
shape_is_nil 
illegal_type_for_shape(debugging version)
parameter_is_nil(debugging version)
SEE ALSO
For general information about rectangle geometries, see "Rectangle Shapes" on page 2-20.

For the definition of the gxRectangle structure, see page 2-106.

To create a new rectangle shape, use the GXNewRectangle function, which is described on page 2-114.

To determine the bounding rectangle of a rectangle shape, use the GXGetShapeBounds function, which is described in the chapter, "Geometric Operations," in this book. (The result of the GXGetShapeBounds function is an ordered rectangle. Therefore, the result of this function may differ from the geometry of the shape you pass in, even if that shape is a rectangle.)

To change the geometry of an existing rectangle shape, use the GXSetRectangle function, which is described in the next section.

To draw a rectangle geometry without creating a rectangle shape, use the GXDrawRectangle function, which is described on page 2-160. To draw a rectangle shape, use the GXDrawShape function, which is described in the chapter "Shape Objects" in Inside Macintosh: QuickDraw GX Objects.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
7 JUL 1996




Navigation graphic, see text links

Main | Page One | What's New | Apple Computer, Inc. | Find It | Contact Us | Help